package com.cjm.one.webmanager.service.system.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.model.system.dto.DeptDto;
import com.cjm.one.model.system.entity.SysDept;
import com.cjm.one.model.system.vo.SysDeptAllVo;
import com.cjm.one.system.client.SysDeptClient;
import com.cjm.one.webmanager.service.system.SysDeptService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysDeptServiceImpl implements SysDeptService {
    @Resource
    private SysDeptClient sysDeptClient;
    @Override
    public List<SysDeptAllVo> getAllList(String deptName, String keyWord) {
       return sysDeptClient.getAllList(deptName,keyWord).getData();

    }

    @Override
    public Page<SysDept> getUserDeptList(DeptDto deptDto) {
        return sysDeptClient.getUserDeptList(deptDto).getData();
    }

    @Override
    public Boolean save(SysDept sysDept) {
        return sysDeptClient.save(sysDept).getData();
    }

    @Override
    public Boolean updateById(SysDept sysDept) {
        return sysDeptClient.update(sysDept).getData();
    }

    @Override
    public SysDept getById(Long id) {
        return sysDeptClient.getById(id).getData();
    }

    @Override
    public Boolean removeById(Long id) {
        return sysDeptClient.removeById(id).getData();
    }
}
